package com.alameda.user.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * 用户实体类
 *
 * @author Lv
 * @date 2024/08/03
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "user", autoResultMap = true)
@ApiModel(value = "UserDO", description = "用户")
public class UserDO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名")
    @TableField("username")
    private String username;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @TableField("password")
    private String password;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称")
    @TableField("nickname")
    private String nickname;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    @TableField("email")
    private String email;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    @TableField("user_pic")
    private String userPic;

    /**
     * 组织id
     */
    @ApiModelProperty(value = "组织id")
    @TableField("organization_id")
    private Long organizationId;

    /**
     * 权限登记（1管理员  2普通用户）
     */
    @ApiModelProperty(value = "权限登记（1管理员  2普通用户）")
    @TableField("power")
    private Integer power;

    /**
     * 创建人ID
     */
    @ApiModelProperty(value = "创建人ID")
    @TableField("create_id")
    private Long createId;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改人id
     */
    @ApiModelProperty(value = "修改人id")
    @TableField("update_id")
    private Long updateId;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 逻辑删除标识符 （0未删除  1已删除）
     */
    @ApiModelProperty(value = "逻辑删除标识符 （0未删除  1已删除）")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    /**
     * 扩展属性
     */
    @ApiModelProperty(value = "扩展属性")
    @TableField(value = "ext_data", typeHandler = FastjsonTypeHandler.class)
    private Map<String, String> extData;

}
